//
//  SWBaseTableViewController.m
//  SinaWeibo2
//
//  Created by zhuangqianwei on 16/11/28.
//  Copyright © 2016年 zhuangqianwei. All rights reserved.
//

#import "SWBaseViewController.h"
#import "WBOAuthViewController.h"
@interface SWBaseViewController ()
@end

@implementation SWBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    _visitorV = [[WBVisitorView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    [self.view addSubview:_visitorV];
    //实现block
    _visitorV.registerBlock = ^{
      NSLog(@"注册");
        
    };
    __weak typeof(self) weakSelf = self;
    _visitorV.loginBlock = ^{
    //要让授权页称为导航根视图,上面才有按钮
    WBOAuthViewController *vc = [[WBOAuthViewController alloc]init];
        UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
        [weakSelf presentViewController:nav animated:YES completion:nil];
        
    };
    
}
//懒加载
-(UINavigationItem *)navItem {
    if (_navItem != nil) {
        _navItem = [[UINavigationItem alloc]init];
    }
    return _navItem;
    
}
-(UINavigationBar *)navBar {
    
    if (_navBar != nil) {
        _navBar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0,screenWidth, 64)];
    }
    
    return _navBar;
    
}

@end
